import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  base: './',
  server: {
    proxy: {
      // 静态资源
      '/static/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      
      // 数据管理中心
      '/set_filepath/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/list_radar_folder_files/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_filelist/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/upload_radar_data/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },

      // 数据查询与分析
      '/get_all_monitoring_points': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_top_150_monitoring_points': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_top_monitoring_points': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_alert_monitoring_points/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/monitoring-data/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_monitoring_threshold/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_displacement_analysis/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/get_displacement_analysis_show/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      
      // 屏蔽区域管理
      '/get_maskareas/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/save_maskares/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/delete_maskares/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },

      '/shieldareas/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
      '/shieldareas/check_point/': {
        target: 'http://127.0.0.1:8000',
        changeOrigin: true,
      },
    },
  },
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
})